# -*- coding: utf-8 -*-
class UserProfilesController < ApplicationController
  def show
    p "--------------------------------------------------"
    p current_user
    @user = User.find(current_user)
    @user_profile = @user.user_profile
  end

  def new
    @user_profile = UserProfile.new
  end

  def create
    @user = User.find(current_user)
    @user_profile = UserProfile.create(params[:user_profile])
    @user.user_profile = @user_profile
    if @user.save
      flash[:notice] = 'ユーザプロフィールを作成しました。'
      redirect_to @user_profile
    else
      render :action => :new
    end
  end

  def edit
  end

end
